﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using System.Collections;

using Rmlife.Common;
using Rmlife.Site;
using Rmlife.Config;
using Rmlife.Model;
namespace Rmlife.Web
{
    [Serializable]
    public class mark : System.Web.UI.Page, System.Web.IHttpHandler
    {
        int cnt = 0;
        BookmarkInfo info = null;
        new public void ProcessRequest(HttpContext Context)
        {
            int BookmarkID = WebReq.GetInt("BookmarkID", 0);
            string BookmarkUrl = WebReq.GetString("BookmarkUrl");
            string Title = WebReq.GetString("Title");
            string ThumbnailUrl = WebReq.GetString("ThumbnailUrl");
            string UserID = WebReq.GetString("UserID");
            string Author = WebReq.GetString("Author");
            string DateCreated = WebReq.GetString("DateCreated");

            info = new BookmarkInfo();
            info.BookmarkID = BookmarkID;
            info.BookmarkUrl = BookmarkUrl;
            info.Title = Title;
            info.ThumbnailUrl = ThumbnailUrl;
            cnt = Bookmarks.ExistByID(BookmarkID);
            if (cnt > 0)
            {
                Bookmarks.UpdateBookmarkInfo(BookmarkID);
            }
            else
            {
                info.AuditingStatus = 1;
                info.BackerCount = 1;
                info.CommentCount = 1;
                info.DayHitTimes = 1;
                info.DissenterCount = 1;
                info.HitTimes = 1;
                info.PrivacyStatus = 1;
                info.WeekHitTimes = 1;
                info.DateCreated = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
                Bookmarks.AddBookmarkInfo(info);
            }
        }

    }
}
